package com.ithuameng.admin.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 项目配置
 *
 * @author ithuameng
 */
@Data
@ConfigurationProperties(prefix = "admin")
@Component
public class AdminCfgProp {

    private JwtProp jwt = new JwtProp();

    private SwaggerProp swagger = new SwaggerProp();

    @Data
    public class JwtProp {
        private String secret;
    }

    @Data
    public class SwaggerProp {

        /**
         * 是否开启Swagger
         */
        private boolean enable = false;

        /**
         * 要扫描的包
         */
        private String basePackage;

        /**
         * 标题
         */
        private String title;

        /**
         * 描述
         */
        private String description;

        /**
         * 版本信息
         */
        private String version;

        /**
         * 是否集成Spring Security
         */
        private Boolean security = false;

        /**
         * 联系人
         */
        private Contact contact = new Contact();

        @Data
        public class Contact {

            private String name;

            private String url;

            private String email;
        }
    }
}
